/**
* @description : 无证户信息展示组件
* @descriptionDetail : 无证户信息item展示组件
* @copyright : 浙江烟草
* @author : mc
* @create : 2022-12-05 15:22:03
*/
<template>
	<view class="main" @click="showDetail(info.retailerUuid)">
		<view class="topLine">
			<text class="nameText">
				无证户姓名: {{ info.managerName || '/' }}
			</text>
			<text class="re-tit">
				{{ info.distance ? info.distance : "未知" }}
			</text>
		</view>
		<view class="nameLine">
			<view class="fl-sh-0">
				登记时间：
			</view>
			<view>
				{{ info.createTime }}
			</view>
		</view>
		<view class="nameLine">
			<view class="fl-sh-0">
				企业名称：
			</view>
			<view>
				{{ info.companyName }}
			</view>
		</view>
		<view class="nameLine">
			<view class="fl-sh-0">
				经营内容：
			</view>
			<view>
				{{ getDicBCNames() }}
			</view>
		</view>
		<view class="nameLine">
			<view class="fl-sh-0">
				经营状态：
			</view>
			<view>
				{{ info.licStatusName }}
			</view>
			<view style="margin-left:auto" v-if="isInterview">
				<u-tag style="flex-shrink: 0; height: fit-content" mode="dark" shape="circle" text="走访" @click.native.stop="goInterview(info)"></u-tag>
			</view>
		</view>
		<view class="nameLine">
			<view class="fl-sh-0">
				店铺地址：
			</view>
			<view>
				{{ info.businessAddr }}
			</view>
		</view>
	</view>
</template>

<script>
	const sysCodeColors = {
		"02": {
			// "label": "基础管理",
			color: "#0079F2",
			borderColor: "#0079F2",
			backgroundColor: "#E0ECFF",
		},
	};
	export default {
		props: {
			info: {
				type: Object, // keys['personName','status','companyName','businessAddr']
				default: undefined,
			},
			isInterview: {
				type: String,
				default: ''
			}
		},
		data() {
			return {
				status: this.$u.dic.getDicNameByKeyCode('L_UNLICENSE_LICSTATUS', this.info.licStatus),
			}
		},
		mounted() {},
		methods: {
			goInterview(row) {
				this.$emit("goPage", row)
			},
			/**
			 * @description 点击信息跳转详情
			 * @params retailerUuid 主键
			 */
			showDetail(retailerUuid) {
				// 定义跳转参数
				const params = {
					retailerUuid,
				};
				this.setRouteParam(params);
				this.$u.route('/pages/query/nolicence/detailUnlicense');
			},
			getStatusFilter() {
				if (this.info == undefined) return "";
				return this.$u.dic.getDicNameByKeyCode(this.$u.dic.DIC_KEYS.UNLICENSE_STATUS, this.info.licStatus);
			},
			getSpStyle(it) {
				return sysCodeColors[it.licStatus] || {};
			},
			getDicBCNames() {
				if (this.info == undefined) return "";
				return this.$u.dic.getDicNameByKeyCode(this.$u.dic.DIC_KEYS.L_BUSINESS_CONTENT, this.info.businessContent);
			},
		},
	};
</script>

<style lang="scss" scoped>
	.main {
		margin: 10rpx 0rpx;
	}

	.topLine {
		display: inline-flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		width: 100%;
	}

	.nameText {
		font-weight: bold;
		color: black;
		padding-left: 10rpx;
	}

	.nameLine {
		display: flex;
		padding: 10rpx 10rpx;
		color: $u-tips-color;
	}

	.fl-sh-0 {
		flex-shrink: 0;
	}

	.adressLine {
		padding: 10rpx 10rpx;
		color: $u-tips-color;
	}
</style>